home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-08 | 8.2 KB | 254 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWLink.h
- // Release Version: $ 1.0d11 $
- //
- // Copyright: © 1995 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWLINK_H
- #define FWLINK_H
-
- #ifndef FWSTDDEF_H
- #include "FWStdDef.h"
- #endif
-
- #ifndef FWRUNTYP_H
- #include "FWRunTyp.h"
- #endif
-
- #ifndef _ODTYPES_
- #include <ODTypes.h>
- #endif
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export on
- #endif
-
- //========================================================================================
- // Forward Declarations
- //========================================================================================
-
- class FW_CLASS_ATTR ODStorageUnit;
- class FW_CLASS_ATTR ODLinkSource;
- class FW_CLASS_ATTR ODLink;
- class FW_CLASS_ATTR FW_CPresentation;
- class FW_CLASS_ATTR FW_CPart;
-
- //========================================================================================
- // class FW_CPublishLink
- //========================================================================================
-
- class FW_CLASS_ATTR FW_CPublishLink
- {
- public:
- FW_DECLARE_CLASS
-
- FW_CPublishLink(Environment* ev,
- ODUpdateID updateID,
- FW_CPresentation* presentation);
- virtual ~ FW_CPublishLink();
-
- virtual void Publish(Environment* ev) = 0;
- virtual void ExternalizeLinkContent(Environment* ev, ODStorageUnit* linkSU) = 0;
-
- virtual void ContentUpdated(Environment* ev,
- ODUpdateID updateID,
- FW_Boolean forceUpdate = FALSE);
-
- virtual ODValueType GetPublishFormat(Environment* ev);
-
- virtual FW_Boolean IsOKtoUpdate(Environment* ev, FW_Boolean forceUpdate);
-
- virtual void BreakLink(Environment* ev);
- virtual void RestoreLink(Environment* ev, FW_CPart* part);
-
- ODLinkSource* GetODLinkSource(Environment* ev) const;
- void SetODLinkSource(Environment* ev, ODLinkSource* odLinkSource);
-
- FW_Boolean IsPending(Environment* ev) const;
- ODUpdateID GetUpdateID(Environment* ev) const;
- ODUpdateID GetPendingID(Environment* ev) const;
- void SetPendingID(Environment* ev, ODUpdateID id);
-
- FW_Boolean GetSelectState(Environment* ev) const;
- void SetSelectState(Environment* ev, FW_Boolean state);
-
- protected:
- ODLinkSource* fODLinkSource;
- ODUpdateID fUpdateID;
- FW_CPresentation* fPresentation;
- private:
- ODUpdateID fPendingID; // changeID written to link spec
- FW_Boolean fSelected;
- };
-
- //========================================================================================
- // FW_CPublishLink Inlines
- //========================================================================================
-
- //----------------------------------------------------------------------------------------
- // FW_CPublishLink::GetODLinkSource
- //----------------------------------------------------------------------------------------
- inline ODLinkSource* FW_CPublishLink::GetODLinkSource(Environment* ev) const
- {
- return fODLinkSource;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CPublishLink::IsPending
- //----------------------------------------------------------------------------------------
- inline FW_Boolean FW_CPublishLink::IsPending(Environment* ev) const
- {
- return fODLinkSource == NULL;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CPublishLink::GetUpdateID
- //----------------------------------------------------------------------------------------
- inline ODUpdateID FW_CPublishLink::GetUpdateID(Environment* ev) const
- {
- return fUpdateID;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CPublishLink::GetPendingID
- //----------------------------------------------------------------------------------------
- inline ODUpdateID FW_CPublishLink::GetPendingID(Environment* ev) const
- {
- return fPendingID;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CPublishLink::SetPendingID
- //----------------------------------------------------------------------------------------
- inline void FW_CPublishLink::SetPendingID(Environment* ev, ODUpdateID id)
- {
- fPendingID = id;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CPublishLink::GetSelectState
- //--------------------------------------------------------------------
- inline FW_Boolean FW_CPublishLink::GetSelectState(Environment* ev) const
- {
- return fSelected;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CPublishLink::SetSelectState
- //--------------------------------------------------------------------
- inline void FW_CPublishLink::SetSelectState(Environment* ev, FW_Boolean state)
- {
- fSelected = state;
- }
-
- //========================================================================================
- // class FW_CSubscribeLink
- //========================================================================================
-
- class FW_CLASS_ATTR FW_CSubscribeLink
- {
- public:
- FW_DECLARE_CLASS
-
- FW_CSubscribeLink(Environment* ev,
- ODLink* odLink,
- ODLinkInfo* linkInfo,
- FW_CPresentation* presentation);
- virtual ~FW_CSubscribeLink();
-
- virtual void Subscribe(Environment* ev) = 0;
-
- virtual void LinkUpdated(Environment* ev, ODUpdateID updateID);
-
- virtual void DoUpdateLink(Environment* ev, ODStorageUnit* linkContentSU) = 0;
- virtual void DoPropagateChanges(Environment* ev, ODUpdateID updateID);
-
- virtual void BreakLink(Environment* ev);
- virtual void RestoreLink(Environment* ev, FW_CPart* part);
-
- ODLink* GetODLink(Environment* ev) const;
- FW_Boolean IsAutoUpdate(Environment* ev) const;
-
- FW_Boolean IsRegistered(Environment* ev) const;
- void Register(Environment* ev, FW_CPart* itsPart);
- void Unregister(Environment* ev);
-
- FW_Boolean GetSelectState(Environment* ev) const;
- void SetSelectState(Environment* ev, FW_Boolean state);
-
- ODUpdateID GetUpdateID(Environment* ev) const;
- void HandleSubscribe(Environment* ev);
-
- protected:
- ODLink* fODLink;
- ODLinkInfo fLinkInfo;
- FW_CPresentation* fPresentation;
- private:
- FW_Boolean fRegistered;
- FW_Boolean fSelected;
- FW_CPart* fPart;
- FW_Boolean fNeedsSubscribe;
- };
-
- //========================================================================================
- // FW_CSubscribeLink Inlines
- //========================================================================================
-
- //----------------------------------------------------------------------------------------
- // FW_CSubscribeLink::GetODLink
- //----------------------------------------------------------------------------------------
- inline ODLink* FW_CSubscribeLink::GetODLink(Environment* ev) const
- {
- return fODLink;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CSubscribeLink::IsAutoUpdate
- //--------------------------------------------------------------------
- inline FW_Boolean FW_CSubscribeLink::IsAutoUpdate(Environment* ev) const
- {
- return fLinkInfo.autoUpdate;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CSubscribeLink::IsRegistered
- //--------------------------------------------------------------------
- inline FW_Boolean FW_CSubscribeLink::IsRegistered(Environment* ev) const
- {
- return fRegistered;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CSubscribeLink::GetSelectState
- //--------------------------------------------------------------------
- inline FW_Boolean FW_CSubscribeLink::GetSelectState(Environment* ev) const
- {
- return fSelected;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CSubscribeLink::SetSelectState
- //--------------------------------------------------------------------
- inline void FW_CSubscribeLink::SetSelectState(Environment* ev, FW_Boolean state)
- {
- fSelected = state;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CSubscribeLink::GetUpdateID
- //--------------------------------------------------------------------
- inline ODUpdateID FW_CSubscribeLink::GetUpdateID(Environment* ev) const
- {
- return fLinkInfo.change;
- }
-
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export off
- #endif
-
- #endif
-